1. Technical Field
The present invention relates to data processing and, in particular, to performance benchmarks. Still more particularly, the present invention provides a method, apparatus, and program for eliminating thread skew in multithreaded performance benchmarks.
2. Description of Related Art
A benchmark is a test that measures the performance of a system or subsystem on a well-defined task or set of tasks. Benchmarks are commonly used to predict the performance of an unknown system on a known, or at least well-defined, task or workload. Benchmarks can also be used as monitoring and diagnostic tools. By running a benchmark and comparing the results against a known configuration, one can potentially pinpoint the cause of poor performance. Similarly, a developer can run a benchmark after making a change that might impact performance to determine the extent of the impact.
Performance benchmarks are typically designed to time a certain activity of interest for a certain period and compute the performance as either a rate (i.e. units/sec) or as a latency (i.e. sec/unit). However, complications arise if the benchmark is highly multithreaded. If a processor runs tens of threads or more, a phenomenon called thread skew can occur.
With reference to FIG. 1, a diagram illustrating thread skew is shown. In a multithreaded benchmark, a master thread controls multiple worker threads and handles all the timing. While the nominal measurement interval is from the start of the test to the time the test stops, individual worker threads all start or stop some time after the event has been signaled by the master depending on when they are run by the operating system dispatcher. As a result, the measurement interval includes intervals A and B when not all the threads are actually competing with each other. To accurately measure a multithreaded system in steady state operation, it is desirable to reduce intervals A and B to zero; otherwise, the resulting measurement does not truly characterize the system's performance.
One simple solution is to run the test for a very long time, where the measurement interval is much greater than A+B. However, in a highly multithreaded benchmark, this approach may lead to run times of hours rather than minutes. Therefore, it would be advantageous to provide an improved mechanism for eliminating thread skew in multithreaded performance benchmarks.